Simplify show page a little
authorjustbur <justin@burkett.cc>
Wed, 22 Jul 2015 20:10:31 +0000 (16:10 -0400)
committerjustbur <justin@burkett.cc>
Wed, 22 Jul 2015 20:10:31 +0000 (16:10 -0400)
which-key.el

index cc98e2e7cdbdf5bec97bc0efd7c145e02bccb0ff..bff977b0896a7140f8d7acd55cdcfc4616ad7a6c 100644 (file)
@@ -947,8 +947,9 @@ enough space based on your settings and frame size." prefix-keys)
              (dash-w-face (propertize "-" 'face 'which-key-key-face))
              (status-left (propertize (format "%s/%s" (1+ i) n-pages)
                                       'face 'font-lock-comment-face))
-             (status-top (propertize (format "(%s of %s)" (1+ i) n-pages)
-                                     'face 'font-lock-comment-face))
+             (status-top (when (< 1 n-pages)
+                           (propertize (format "(%s of %s)" (1+ i) n-pages)
+                                       'face 'font-lock-comment-face)))
              (first-col-width (+ 2 (max (string-width prefix-w-face)
                                         (string-width status-left))))
              (prefix-left (s-pad-right first-col-width " " prefix-w-face))
@@ -967,16 +968,11 @@ enough space based on your settings and frame size." prefix-keys)
                        first (concat prefix-left (car lines) "\n" (s-repeat first-col-width " "))
                        new-end (concat "\n" (s-repeat first-col-width " "))
                        page  (concat first (mapconcat #'identity (cdr lines) new-end)))))
-              ((and (< 1 n-pages)
-                    (eq which-key-show-prefix 'top))
-               (setq page (concat prefix-w-face dash-w-face "  " status-top "\n" page)))
               ((eq which-key-show-prefix 'top)
-               (setq page (concat prefix-w-face dash-w-face "  \n" page)))
-              ((and (< 1 n-pages)
-                    (eq which-key-show-prefix 'echo))
-               (let (message-log-max) (message "%s" (concat prefix-w-face dash-w-face "  " status-top))))
+               (setq page (concat prefix-w-face dash-w-face "  " status-top "\n" page)))
               ((eq which-key-show-prefix 'echo)
-               (let (message-log-max) (message "%s" (concat prefix-w-face dash-w-face "  ")))))
+               (let (message-log-max)
+                 (message "%s" (concat prefix-w-face dash-w-face "  " status-top)))))
         (which-key--lighter-status n-shown n-tot)
         (if (eq which-key-popup-type 'minibuffer)
             (let (message-log-max) (message "%s" page))